/**
 * 结构体里的成员 是指针
 */
#ifndef __STUDENT_POINTER_DEFINE__
#define __STUDENT_POINTER_DEFINE__

#include <stdio.h>

//结构体里的成员 是指针
struct Student_Pointer {
    char *name;     //指针才能malloc(), 数组编译不过
    int age;
    int *score;
};

void printStudentPointerExtra(char *extra, struct Student_Pointer *stu) {
    if (extra != NULL) printf("%s\n", extra);
    printf("name = %s, age = %d, score = %d,%d\n", stu->name, stu->age, stu->score[0], stu->score[1]);
}
void printStudentPointer(struct Student_Pointer *stu) {
    printStudentPointerExtra(NULL, stu);
}
#endif //__CLION_CPPTEST_STUDENT_POINTER_H__

